package cn.s1995.sloth.bizs.util;

import lombok.experimental.UtilityClass;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;
import java.util.List;
import java.util.Random;

/**
 * NameGenUtil
 *
 * @author Lex
 * @description 名称生成工具类
 * @date 2024/04/18 08:57
 */
@Slf4j
@UtilityClass
public class NameGenUtil {

    public static final String PREFIX = "Panda";

    private static final List<String> NAMES = Arrays.asList(
            "Bamboo",
            "Bamboo Rat",
            "Carrot",
            "Pumpkin",
            "Apple",
            "Pear",
            "Sugar Cane",
            "Grass",
            "Banana",
            "Cucumber",
            "Wild Fruit",
            "Peach",
            "Lemon",
            "Papaya",
            "Jackfruit",
            "Passion Fruit",
            "Pomelo",
            "Coconut",
            "Durian",
            "Pineapple",
            "Mango",
            "Pomegranate"
    );

    public static void main(String[] args) {

        for (int i = 0; i < 10; i++) {
            System.out.println(genRandomName());
        }

    }


    /**
     * 自动生成名字
     * @return
     */
    public static String genRandomName() {
        Random random = new Random();
        int index = random.nextInt(NAMES.size());
        return PREFIX + " " + NAMES.get(index);
    }


}
